uniform mat4 pMatrix;
uniform mat4 mvMatrix;

uniform vec4 vp;
uniform vec4 light0;
uniform vec4 light1;
uniform vec4 light2;

attribute vec3 a_position;
attribute vec3 a_normal;

varying vec3  vNormal;
varying vec3  vLight1;
varying vec3  vLight2;
varying vec3  vLight3;
varying vec3  vView;

void main(void)
{
   // Output transformed vertex position: 
   gl_Position = pMatrix * mvMatrix * vec4(a_position, 1.0);   

   vNormal = a_normal;

   // Compute the view vector: 
   vView = normalize( vp.xyz - a_position.xyz );

   // Compute vectors to three lights from the current vertex position: 
   vLight1 = normalize(light0.xyz - a_position.xyz);   // Light 1
   vLight2 = normalize(light1.xyz - a_position.xyz);   // Light 2
   vLight3 = normalize(light2.xyz - a_position.xyz);   // Light 3
 }